AmiVNC - An experimental VNC server for the Amiga - V0.0.11

Stéphane Guillard - stephane.guillard@steria.fr

 

1 - Introduction

1.1 - What is VNC ?

VNC is a truly thin client protocol which enables the use of one computer (the server) from another (the client), by :

More can be found on VNC at the VNC homepage at http://www.orl.co.uk/vnc/index.html

1.2 - What is AmiVNC ?

I felt frustrated when I saw on a French magazine ("Dream") a CD including clients & servers for VNC for nearly all platforms, excepted a server for the Amiga !

The Amiga VNC Client (VVA) is in big parts Copyright (C) 1998, 1999 Joerg Dietrich, and available at http://perso.cybercable.fr/dspach (mailto:dspatch@cybercable.fr).

Starting from the documentation distributed with the source for VNC servers for X11 and Win32, I brought up a prototype VNC server for the Amiga. It does not pretend to be complete (by far), but it works on my setup, and I use it from a Win32 VNC clien t.

1.3 - What is AmiVNC status ?

AmiVNC is © S. Guillard, freeware, and can freely be enhanced, as long as you send me your enhancements :-)

I would be happy to have feedback from testers and developers in order to enhance it. I work on it at spare time.

1.4 - Foreword on my setup

I develop and test AmiVNC on 2 Amigas :

2 - Theory of operation

The parameters available are :

Turn your mouse pointer into a soft sprite (for Picasso96: set the SOFT-SPRITE tooltype of Devs:Monitors/<your gfx board> to Yes ; for cybergraphics, there must be some env var to set).

Then reboot to take this into account. Set up your Workbench to 1024x768, 15 or 16 bits (the most efficient depth). Launch your TCP-IP stack.

Then you launch AmiVNC on your Amiga (Shell or WB). It should output something like this :

AmiVNC 0.0.10 May 17 1999
(c) 1999
stephane.guillard@steria.fr
main.c / main : Creating listener socket
main.c / main : Binding socket on port 5900
main.c / main : Listening set on port 5900
main.c / main : Waiting for client connection

Then you launch a VNC client on another computer (local connections are meaningless and crashfull), and you can remotely operate your Amiga (with limitations due to the experimental nature of AmiVNC, mentioned above). At this step, the server outputs something like the following :

main.c / main : accept()ed socket 4
main.c / main : Negociating protocol version
main.c / main : Protocol supported by server : 3.3, by client : 3.3
main.c / main : Authentication

An initial phase takes place for establishing the session (mainly authentication by inputting password on the client, protocol version negotiation, pixel format negotiation). If authentication is ok, the server out puts something like the following :

main.c / main : ClientInitialisation
main.c / main : SharedFlag = 0 (multiple clients : No)
main.c / main : RTG mode 7
main.c / main : @ 0x410B3290, 1024x768, 2 Bpp, size 1572864
main.c / vProcessIncomes runs on socket 0

When the client is connected, two processes run concurrently :

This dual threaded model is necessary due to the very busy nature of the main process. It enables smooth mouse and keyboard operation, taking place at the same moment as screen updates.

The link between the client and the server is a TCP-IP socket bound to port 5900 on the server (5900 is the VNC default, you can change it using the -s command line argument).

Then, you should be able to play with your Amiga in the VNC client window (although AmiVNC still lacks features, as said above).

You exit by closing your client. The server then outputs something like the following :

main.c / vProcessIncomes halted
AmiVNC - main.c / main : send() error (32)
AmiVNC session closed
main.c / main : Waiting for client connection

AmiVNC is now waiting for another incoming connection.

You can halt AmiVNC by selecting its message output window on the Workbench screen, and entering CTRL-C.

AmiVNC supports none of the advanced encoding schemes described in the VNC protocol documentation. Instead, it deals with squares called Tiles in the source, of which you can modify the size (constant XDC_TILE in AmiVNC.c). For my setup, 32 x 32 pixel tiles are a good compromise between screen update speed and network efficiency (I use a 16 bit workbench screen). Tiles are always sent using RAW encoding scheme, which should be supported by all VNC clients.

3 - Requirements

3.1 - To run AmiVNC

You need :

3.2 - To build AmiVNC

AmiVNC is fully written in C. DES authentication is done using 2 C files almost unchanged from the Win32 source distribution : d3des.c and vncAuth.c, and their associated header files. See in these files for copyright information.

To compile it using the source included in the archive, you need :

You may have to change SCOpts file to match your settings for include files and lib directories. Edit these files with an editor.

4 - Limitations and future

Mode

Picasso96 id

CGFX id

Tested

By

8 bit (256 c) - CLUT
24 bit true color R8G8B8
24 bit true color B8G8R8
16 bit PC hi color R5G6B5PC
15 bit PC hi color R5G5B5PC
32 bit true color alpha A8R8G8B8
32 bit true color alpha A8B8G8R8
32 bit true color alpha R8G8B8A8
32 bit true color alpha B8G8R8A8
16 bit hi color R5G6B5
15 bit hi color R5G5B5
16 bit PC hi color B5G6R5PC
15 bit PC hi color B5G5R5PC
15 bit hi color B5G5R5
16 bit hi color B5G6R5PC

1
2
3
4
5
6
7
8
9
10
11
12
13
(none)
(none)

0
9
10
7
3
11
(none)
13
12
5
1
8
4
2
6

Y
Y

Y





Y

Author (see above 8bpp)
Author

Author





Author

Even if it lacks a lot of features, AmiVNC is only 24 K in size, which is about 1/10th the size of Win32 and Unix servers !

5 - Version history

Version

Updates

0.0.11

Enhanced keyboard support (supporting arrow keys, CONTROL, SHIFT, Lamiga = Lalt, Ramiga = Ralt etc.). Better, but still not perfect.

Enhanced mouse support (handles ieQualifier). Better, but still not perfect : in YAM, you can drag your messages but when they come onto a drop area, they are unselected.

Allows screen change IF new screen is the same RGB mode. I did not think it would be very useful, but indeed I use it ! Aborts connection when screen changes if new screen mode is different (as said somewhere above, the VNC clients abort when they receive a mServerInitMsg message in the middle of a session, and this message is necessary to change the resolution).

More command line options :

-e to force Big Endian flag

-(r|g|b)<value> to force red | green | blue bit shift on color encoding, useful if you have color touble. Legal values are 0, 8, 16, 24. Default is -r8 -g16 -b24.

-l<size> to limit network packet size when sending initial screen update. Useful if you have too many network collisions. Default is no limit.

Speed restored under Picasso96 with screen depth = 16 bit pixels. Still slow under CGFX or with screen depth > 2, because still using ReadPixelArray for compatibility. Will try to fix that.

0.0.10rpa

Deals with active screen, not necessarily Workbench (this does not mean you can open a screen in a session !).

No longer a one shot daemon. You can re-connect. Stop with CTRL-C when the server is waiting for connections (if you break it t another state, you may loose memory).

Corrected acquisition of raster pointer, which worked under Pic96 but not under CGFx. Thanks to Steffen Haeuser.

Changed all color encoders to ARGB (32 bit on the wire), and ReadPixelArray(). This is slower, but works with all CGFx and Picasso96 screen modes with depth > 8. As a side effect, AmiVNC is even smaller than before !

This version is successfully running on my setup, with both AmiTCP, Genesis or Miami as a TCP stack, and Picasso96 or CFGx 4 as RTG system.

0.0.9

Useable with Cybergraphics AND Picasso96 (I use the cybergraphics.library calls for fetching screen info, and it works also with Picasso96 emulation library. I personally use Picasso96, and own both systems). Fetches screen info through cybergraphics.library calls, not directly in the bitmap structure.

Enables setting the port number ("-s" argument), because users reported that Siamese uses the same port as VNC : 5900.

Supports 24 bit pixels. AmiVNC already supported 8, 15, 16, 32 bit pixels, but lacked 24 bit pixels. It is much slower than 8, 15/16 or 32 bit pixels, because of the performance impact of having to make 24 bit pixels be come 32 bit pixels for sending them (padding with 1 null pixel).

Works with Miami ! I made a bug in the ObtainSocket() call in the child process, which did not trouble AmiTCP. Thanks Xavier. Excuse me Holger !

0.0.8mt

History really starts there. Previous versions were not really usable releases, even if this one is still far from complete. First version released on Aminet. Does not support 24 bit pixels. Does not enable choosing the port.

0.0.6

Not multithreaded.

6 - Thanks to